﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Backend.Packets;

namespace GameClient.Managers
{
    class AccountManager
    {
        public void RequestLogin(string Login, string Password)
        {
            AccountPacket Payload = new AccountPacket();
            Payload.PacketCommand = AccountPacket.AccountCommand.ACCOUNT_LOGIN_REQUEST;
            Payload.Login = Login;
            Payload.Password = Password;

            GameClient.Managers.ClientManager.GetInstance().Send(Payload);
        }

        private void LoginResponse(string Response)
        {
            ClientManager.GetInstance().ServerMessage(Response);
        }

        public void Parse(AccountPacket Packet)
        {
            switch (Packet.PacketCommand)
            {
                case AccountPacket.AccountCommand.ACCOUNT_LOGIN_RESPONSE:
                    LoginResponse(Packet.Response);
                    break;
            }
        }
    }
}
